<?php
require_once("..\include\database.php");
// loadcombo(name,class,sql,value,text,default)
function loadcombo($name="",$class="",$sql="",$valuef="",$textf="",$def="")
{
	echo "<select name=\"$name\" id=\"$name\" class=\"$class\">";
	if ($sql!="")
	{
	$db= new Database;
	$rs = $db->query($sql);
	while($row = mysql_fetch_array($rs))
	{
	 	$sel= ($def==$row[$valuef])? 'Selected="selected"' :"" ;
	 	echo "<option name=\"$row[$valuef]\" $sel >".htmlspecialchars($row["$textf"])."</option>";
	}
	}
	echo "</select>";
}
?>